home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
076-100
/
disk_099
/
a-render
/
build_objects
/
inputs.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-06
|
988b
|
59 lines
/*
* input routines
*/
#include <exec/types.h>
#include <stdio.h>
#include <intuition/intuition.h>
input_vali(prompt,value)
int *value;
char prompt[];
{
int val;
char character;
printf("%s <%d> - ",prompt,*value);
scanf("%d",&val);
if (val != -1) *value = val;
scanf("%c", &character); /* eat up c/r, why though? */
}
input_valf(prompt,value)
float *value;
char prompt[];
{
char character;
float val;
printf("%s <%f> - ",prompt,*value);
scanf("%f",&val);
if (val != -1) *value = val;
scanf("%c", &character); /* eat up c/r, why though? */
}
input_string(prompt, string)
char prompt[];
char *string[];
{
char character;
char work_string[64];
int cnt = 0;
character = 1;
printf("%s", prompt);
while (character != NULL) {
scanf("%c", &character);
if (character == '\n')
character = NULL;
work_string[cnt] = character;
cnt = cnt + 1;
}
strcpy(string, &work_string); /* string is already pointer */
}